<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html">

    <!-- INTERFACE><-->
    <cc:interface>
        <cc:attribute name="useridValidatorMessage" default="#{messages.invuserName}"/>
        <cc:attribute name="passwordValidatorMessage" default="#{messages.invpassword}"/>
        <cc:attribute name="validateCodeMessage" default="#{messages.invValiCode}"/>
        <cc:attribute name="loginButtonText" default="#{messages.login}"/>
        <cc:attribute name="registerButtonText" default="#{messages.register}"/>
        <cc:attribute name="action" targets="loginButton"/>
        <cc:attribute name="action" targets="RegisterButton"/>
        <cc:editableValueHolder name="userid"/>
        <cc:editableValueHolder name="password"/>
        <cc:actionSource name="loginButton"/>
        <cc:actionSource name="RegisterButton"/>
    </cc:interface>

    <!-- IMPLEMENTATION ><-->
    <cc:implementation>
        <h:form >  
            <h:panelGrid columns="3" rendered="#{checkLogin.rendered}">                
                <h:outputLabel for="#{cc.clientId}:userid" value="#{messages.username}"/>
                <h:inputText value="#{checkLogin.username}" required="true"  id="userid" immediate="true" requiredMessage="#{messages.inputName}" />
                <h:outputLabel/>
                <h:outputLabel for="#{cc.clientId}:password" value="#{messages.password}"/>
                <h:inputSecret value="#{checkLogin.password}" required="true" requiredMessage="#{messages.inputPassword}" id="password" immediate="true" />
                <h:outputLabel/>
                <h:outputLabel/>
                <h:commandButton action="#{checkLogin.validateUser}" id="loginButton" value="#{checkLogin.roleinfo}#{messages.login}"  />
              
                <h:inputHidden value="#{checkLogin.userType}"/>
            </h:panelGrid>
            <h:messages id="message" style="color: red"  infoClass="infMsgs" warnClass="errMsgs" errorClass="errMsgs" fatalClass="errMsgs"/>
            <h:outputLabel  rendered="#{!checkLogin.rendered}" >#{messages.tryFaild}</h:outputLabel>

        </h:form>



    </cc:implementation>
</html>
